<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Hacker Stack - 在线渗透测试平台</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="/resource/javascript/config.js"></script>
        <script src="../js/cookie.js"></script>
        <link href="../css/system.css" rel="stylesheet" />
        <script src="../js/libui.js"></script>
        <script src="../js/system.js"></script>
        <script src="../js/hacker_driver.js"></script>
    </head>
    <body style="height: 100%;padding: 0px;margin: 0px;overflow-y: hidden;overflow-x: hidden;">
        <script>

function login_ok(to_system , showAlert) {
    var get_result = false;
    try {
        var username = getCookie("user");
        var password = getCookie("pwd");
        if (username == "" || password == "") {
            showRightAlert("请先登录" , 3000)
        }
        else {
            
            var xhr = new XMLHttpRequest();
            xhr.open("POST" , "https://user.hackerstack.top/api/v2/login",true);
            xhr.send(JSON.stringify({"user":username,"pwd":password}));
            
            xhr.onload=function() {
            // 返回的是 Json字符串，自己去处理,默认的信息是 {"message":"login successful."}
            var json_content = xhr.responseText;
            console.log(json_content);
            var json = JSON.parse(json_content);
            if (json["message"] == "login successful.") {
                setCookie("user" , username);
                setCookie("pwd" , password);
                
                if (json['server'] == false) {
                    showAlert("VIP期限已到，请重新订阅" , null)
                    return false;
                }
                else {
                    to_system();
                    get_result = true;
                }
            }
            }
        }
        return get_result;
    }catch (e) {
        showAlert("请先登录" , null)
        return get_result;
    }
}


            function load_js(path) {
                var script = document.createElement('script');
                script.src = path;
                document.head.appendChild(script);
            }

            function close_local_console() {
                document.getElementById("local_console").style.display = "none";
            }


            window.onload=function() {
                
                function isMobileDevice() {
                    const userAgent = navigator.userAgent || navigator.vendor || window.opera;
                    // 正则表达式检查是否是移动端设备
                    return /android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos/i.test(userAgent);
                }
                if (isMobileDevice()) {
                    window.location.href = './pe_index.html'
                }

                print_log("启动Hacker Stack渗透测试系统，请注意，这并不是一个装逼的界面，而是真实的渗透测试平台",1)
            }
        </script>
        <iframe src="../bg.html" style="border: none;width: 100%;height: 100%;position: absolute;"></iframe>
        <div id="load" style="width: 90%;color: rgb(7, 179, 7);display: block;position: absolute;width: 100%;padding: 30px;">
            <h1 id="title"></h1>
            <p id="info"></p>
            <p style="color: red;font-weight: bold;width: 90%;" id="story"></p>
        </div>
        <div style="padding: 0px;margin: 0px;position: absolute;width: 100%;display: block;" id="main_page">
            <Div style="width: 100%;">
                <span class="card_1" style="overflow-y: scroll;top: 0px;">
                    <h2 style="margin: 0px;font-size: 20px;width: 100%;height: auto;background-color: #00FF00;color: black;">
                        功能面板
                    </h2>
                    <div style="padding: 5px;">
                        <button class="btn_2" onclick="to_social()">社会工程学</button>
                        <button class="btn_2" onclick="window.open('https://web.hackerstack.top')">浏览器控制木马攻击</button>
                        <button class="btn_2" onclick="to_ip_location()">IP定位</button>
                        <button class="btn_2" onclick="to_whois()">Whois查询</button>
                        <button class="btn_2" onclick="window.open('https://google.hackerstack.top')">Google反向代理</button>
                        <button class="btn_2" onclick="make_qrcode()">二维码生成</button>
                        <button class="btn_2" onclick="to_VirusInfoGetter()">被动式信息收集木马</button>
                        <button class="btn_2" onclick="to_Nmap()">Nmap信息收集</button>
                        <button class="btn_2" onclick="to_sqlmap()">SqlMap数据库注入</button>
                        <button class="btn_2" onclick="to_js_console()">Js控制台</button>
                        <button class="btn_2" onclick="to_dns_search()">网站DNS查询(绕防火墙专用)</button>
                        <button class="btn_2" onclick="to_subdomain()">子域名收集</button>
                        <button class="btn_2" onclick="document.getElementById('page').src='./bug/'">Nikto漏洞扫描</button>
                        <button class="btn_2" onclick="document.getElementById('page').src='./mirrors/'">镜像网站大全</button>
                        <button class="btn_2" onclick="document.getElementById('page').src='./dirb/'">Dirb目录爆破</button>
                        <button class="btn_2" onclick="document.getElementById('page').src='./info_getters/'">信息安全资产收集平台</button>
                        <button class="btn_2" onclick="document.getElementById('page').src='./icp/'">ICP备案查询</button>
                    </div>
                </span>
                <script>
                    function to_doc() {
                        login_ok(function() {
                            window.location.href='../edu/edu.pdf'
                        } , showAlert);
                    }
                </script>
                <span class="card_2" style="height: 30px;background-color: #00FF00;left: calc(15% + 50px);color: #00FF00;">
                    <button class="top_btn_1" onclick="document.getElementById('page').src='./default.html'">首页</button>
                    <button class="top_btn_1" onclick="window.open('../attack_tools.html')">本地渗透软件</button>
                    <button class="top_btn_1" onclick="to_doc()">教材</button>
                    <button class="top_btn_1" onclick="alert('分免费版本和付费版本，免费的咨询就是咨询网络安全小问题以及部分技巧，付费咨询主要是如何学习以及推荐人脉等的资源，请联系QQ：2382546858')">付费咨询</button>
                </span>
                <iframe style="color: #00FF00;top: 30px;left: calc(15% + 50px);" id="page" src="./default.html" class="card_2">
                    
                </iframe>
                <div style="display: none;padding: 0px;margin: 0px;height: calc(60vh + 10px);color: #00FF00;top: 30px;left: calc(15% + 50px);backdrop-filter: blur(5px);border: 10px solid #00FF00;width: calc(60% + 15px);" id="local_console" class="card_2">
                    <h2 style="margin: 0px;font-size: 20px;width: 100%;height: auto;background-color: #00FF00;border-top: 3px solid black;color: black;">本地信息控制台
                        <button class="btn_2" style="width: 80px;float: right;;margin-top: 0px;background-color: black;" onclick="close_local_console()">关闭</button>
                    </h2>
                    <br />
                    <div style="margin-left: 10px;margin-right: 10px;width: calc(100% - 10px);" id="local_console_content">

                    </div>
                </div>
                <span class="card_2" style="overflow-y: scroll;height: calc(32vh + 7px);left: calc(15% + 50px);top: calc(60vh + 60px);color: #00FF00;">
                    <h2 style="margin: 0px;font-size: 20px;width: 100%;height: auto;background-color: #00FF00;color: black;">本地驱动渗透测试功能</h2>
                    <div id="local_fn" style="padding: 10px;">
                        <p>等待连接本地驱动 ... ...</p>
                    </div>
                </span>
                <div style="display: block;overflow-y: hidden;" class="card_3">
                    <div style="width: 100%;height: 40vh;margin: 1vh;border-bottom: 3px solid #00FF00;margin: 0px;">
                        <h3 style="width: 100%;height: auto;background-color: #00FF00;color: black;margin: 0px;">连接本地驱动</h3>
                        <div style="padding: 5px;">
                            <button class="btn_2" onclick="window.location.href='https://api.hackerstack.top/resource/hackerstack_driver.zip'">下载黑客驱动</button>
                            <br />
                            <p id="driver_code">识别码: </p>
                            <p id="driver_ip">IP: </p>
                            <p id="driver_os">系统: </p>
                        </div>
                    </div>
                    <h3 style="width: 100%;height: auto;background-color: #00FF00;color: black;margin: 0px;">日志控制台</h3>
                    <div style="overflow-y: scroll;padding: 5px;height: calc(59vh - 40px)" id="log_console">

                    </div>
                </div>
            </Div>
    </body>
</html>